home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
bbsutil
/
logmgr16.zip
/
LOGMGR.DOC
< prev
next >
Wrap
Text File
|
1991-07-10
|
7KB
|
189 lines
Syntax: logmgr logfile logpatt arcpatt -a "arc cmd" [-k n1] [-s n2] [-l]
[-m] [-v] [-w]
Function: maintains a logfile directory.
Arguments:
logfile
is the name of the currently existing log file.
logpatt
specifies a naming pattern for the logfile to be renamed to.
arcpatt
specifies an archive filename pattern to be used for storing
old logfiles.
"arc cmd"
specifies the command and initial arguments for archiving
old logs. Note that quotes are required if this argument
contains any spaces.
-k n1
specifies how many old log to keep. Old logs in
excess of this count will be deleted. A specification of zero
(the default) means that no old logs will be deleted. Note:
this count includes the just-renamed log.
-s n2
specifies how many old archives to keep. Old ones in
excess of this count will be deleted. A specification of zero
means that no old archives will be deleted. The default is 2.
-l
log all logmgr actions to the newly-created logfile.
-m
create new archive files monthly (the default).
-v
log all logmgr actions to the stdout (usually the console
but can be redirected).
-w
create new archive files weekly (the default is monthly).
Note:
The "/" character may be used in place of "-" for those who prefer
this style (.e.g /k 2).
Warning:
If you change from monthly to weekly archives using the same arcpattern
you CANNOT change back until the beginning of the next year. The logmgr
has no way of determining whether, for example, log-1290.arc refers
to the archive for week 12 or for December except by the frequency
specified in the command line (either explicitly or implicitly). Changing
from monthly to weekly causes no problems, except for a gap in the
numbering of the archives.
Description:
The logmgr command functions as follows:
1) The current logfile is renamed to a name created from the logpattern
argument. Currently this is limited to a Julian-date specification,
e.g. fd-log.###, where the ### is translated to the Julian day number.
If this file already exists then logmgr has already been run today
and will exit.
2) All other (excluding today's) old logs matching the logpattern
are archived using the "arc cmd" string into an archive file derived
from the arcpattern command. Currently this is limited to a month/year
specification, e.g., log-####, where the #### will be translated
to the MMYY digits of the month and year, for monthly archives (the
default), or WWYY digits of the week and year for weekly archives
(specified via the -w option).
3) All archives (including, potentially, the current one) matching the
arcpatt(.*) in excess of the specified count will be deleted.
4) All old logs matching the logpatt in excess of the specified count
will be deleted.
Example:
Today is December 16, 1990, i.e. day 350 of the year. Currently existing
archive files are log-1189.arc log-1289.arc, log-0190 thru log-1190 (the
logmgr has not been run recently), together with old log files fd-log.345
thru fd-log.349.
The command line
logmgr fd.log fd-log.### log-#### -a "arc m" -s 10 -l -v
results in the following actions:
1) fd.log is renamed fd-log.350
2) the command line
arc m log-1290 fd-log.345 fd-log.346 fd-log.347 fd-log.348 fd-log.349
is executed
3) the old archive files log-1189.arc, log-1289.arc, log-0190.arc and
log-0290.arc are deleted, leaving 10 archive files (log-0390.arc
thru log-1290.arc).
4) all these actions are reported in a newly-created fd.log.
5) all these actions are reported on stdout.
Limitations:
Currently only the Julian date pattern for old logs and the month/year or
week/year patterns for log archives are supported.
Because the extension of the log archive is dependent on the particular
archiving command, arcpatt.* is used to match which files to consider
eligible for deletion. The existence of additional files matching this
pattern (e.g. in the above example log-1289.bak) will cause potential
problems.
The algorithm used to decide which log archives to delete is based solely
upon a sort of the log archive file names. This is done in order to avoid
the potential problems resulting from manual updating of the files if a
date/time modified sort were used.
Implementation:
This program was written in C++ and compiled using Borland C++ version 2.
Note:
The logmgr will swap itself out to whichever is available of extended or
expanded memory or a temporary disk file while executing the archival
command.
Version:
This document describes logmgr version 1.60, July 10, 1991.
Copyright (C), Jupiter Software, 1990, 1991.
All Rights Reserved
╔═══════════════════════════════ DISCLAIMER ═════════════════════════════════╗
║ The author makes no warranties expressed or implied as to the quality or ║
║ performance of this program. The author will not be held liable for any ║
║ direct, indirect, incidental, or consequential damages resulting from the ║
║ use of this program. Your use of the program constitutes your agreement ║
║ to this disclaimer and your release of the author from any form of ║
║ liability or litigation. ║
╚════════════════════════════════════════════════════════════════════════════╝
$25 shareware contribution is requested for the use of the program.
Users of this program are invited to send contributions to help the
author maintain it and to develop other, similarly useful, programs.
Please send contributions, comments, suggestions, etc., to:
Jupiter Software,
587, Langvista Drive,
Victoria
British Columbia
V9B 5N3
Canada
IMEx: 89:688/21
InterNet: Deryk.Barker@f21.n688.z89.imex.org
* This program is distributed for personal, private, non-commercial use.
* The author retains the sole right to sell the program.
* The author grants users the right to copy and distribute the program within
the following constraints:
* All program files remain unaltered and are distributed en masse.
* No attempt is made to sell the program, or to make money from it or any
modified version of it.
* The program is not bundled with any other hardware/software transactions.
* Commercial use of the program without a license is prohibited.
* Corporations and other institutions which desire commercial use of the
program should contact the author for a site licensing agreement.